<div id="headerPage">
    <span>Laboratórios</span>
</div>
<table id="table" border="1" rules="rows" align="center" class="table">
    <thead>
        <th>Código</th>
        <th align="left">Nome</th>
        <th>Nº Laboratório</th>
        <th>----</th>
        <th>----</th>
        <th>----</th>
        <th>----</th>
    </thead>
    <tbody>
        <?php
        $i = 0;
        foreach ($laboratorios as $lab){
            $color = ($i % 2) == 0 ? '#ffffff' : '#e0e0e0';
                if ($lab->chave_laboratorio == '1'){
                    $color = '#FF7F50';
                }
            
            echo "<tr bgcolor='{$color}'>
                    <td>{$lab->id_laboratorio}</td>
                    <td align='left'>{$lab->nome_laboratorio}</td>
                    <td>{$lab->numero_laboratorio}</td>";
                    
                    if ($lab->chave_laboratorio == '1'){
                         echo "<td><a title='Detalhes Chave' href='index.php?modulo=chaves&page=visualizar&labkey={$lab->id_laboratorio}'>
                                   <img src='app.misc/images/ico_produtos.png'></a></td>";
                         echo "<td><a class=open-link title='Concluir Chave' href='index.php?modulo=chaves&page=gerenciar&labkey={$lab->id_laboratorio}'>
                                   <img src='app.misc/images/ico_ok02.png'></a></td>";
                    }else{
                         echo "<td>&nbsp</td>
                               <td>&nbsp</td>";
                    }
                    echo "<td><a title='Editar Laboratório' href='index.php?modulo=chaves&page=gerenciar&lab=1&labkeyedit={$lab->id_laboratorio}'>
                                   <img src='app.misc/images/ico_edit.png'></a></td>";
                    echo "<td><a class=open-link-delete title='Deletar Laboratório' href='index.php?modulo=chaves&page=gerenciar&lab=1&labkeydelete={$lab->id_laboratorio}'>
                                   <img src='app.misc/images/ico_delete.png'></a></td>";
                    
            echo "</tr>";
        $i++;            
        }
        
        ?>
    </tbody>
</table>
<div style="text-align:center; padding-top:20px">
    <button value="Voltar" name="busca" onclick="javascript:location='index.php?modulo=chaves&page=gerenciar&lab=1'">Adicionar</button>
    <button value="Voltar" name="busca" onclick="javascript:location='index.php'">Voltar</button>
</div>

<div id="janela-dialog">
        <form id="form-dialog" class="form" name="frm" method="post" action="">
            <fieldset>
                <label>Tem certeza?</label>
            </fieldset>
        </form> 
</div>

<div id="janela-delete">
        <form id="form-delete" class="form" name="frm" method="post" action="">
            <fieldset>
                 Deseja deletar este Laboratório?
            </fieldset>
        </form> 
</div>
